//
//  NSString+Format.m
//  hihuasheng
//
//  Created by anlun on 15/10/29.
//  Copyright © 2015年 anLun. All rights reserved.
//

#import "NSString+Format.h"

@implementation NSString (Format)
- (NSString *)formatMonery{
	NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
	[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
	[formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]];
	[formatter setCurrencySymbol:@""];
	[formatter setNegativeFormat:@""];
	NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:[self replace:@"," with:@""]];
	return [formatter stringFromNumber:number];
}
- (NSString *)replace:(NSString *)o with:(NSString *)n{
	return [self stringByReplacingOccurrencesOfString:o withString:n];
}
@end
